Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#3544 RV64: Rebase the dcontext pointer. #7235

Open
wants to merge 37 commits into
base: master
Choose a base branch
from

Conversation

mariospaok4
Copy link
Contributor

@mariospaok4 mariospaok4 commented Jan 30, 2025

For RISC-V the dcontext_t struct is larger than the biggest valid displacement of the load and store instructions.
By rebasing the pointer kept in spill_state_t's TLS slot by 0x800, we can access the entire struct, because the displacement can be in the range of -0x800 to 0x7ff. Architectures other than RV64, are unaffected by these changes.

The dcontext_t struct is larger than the biggest valid displacement of the load and store instructions.
By rebasing the pointer by 0x800, we van access the entire struct,
because the dispacement can be in the renge of -0x800 to 0x7ff.
@mariospaok4 mariospaok4 marked this pull request as draft January 30, 2025 09:19
@mariospaok4
Copy link
Contributor Author

mariospaok4 commented Feb 7, 2025

I know that these patches are quite "hacky". However, I could not find a better way to work around some issues.
Currently we use only arithmetic, we can use a separate TLS slot for the displaced dcontext, if it is deemed worthwhile.
That being said, only riscv is affected by the patch and it fixes dr_insert_read_tls_field.
We can add sample client that demonstrates this.
It also seems that no previously passing tests fail.

@mariospaok4 mariospaok4 marked this pull request as ready for review February 7, 2025 10:50
@ziyao233 ziyao233 requested a review from ksco February 8, 2025 08:46
@ksco ksco requested a review from derekbruening February 10, 2025 05:19
@derekbruening
Copy link
Contributor

@ksco ksco requested a review from derekbruening 16 hours ago

FYI I am out of office today; will take a look tomorrow.

@derekbruening
Copy link
Contributor

1 failing and 18 successful checks

The failure is the sourceware.org network issue. Several flaky issues were fixed in the last several days: probably worth merging the latest from master.

@mariospaok4 mariospaok4 requested a review from ksco February 18, 2025 12:25
@derekbruening
Copy link
Contributor

This alpine failure just appeared: #7284. Triager should be disabling that job as it's blocking everything.

Copy link
Member

@ziyao233 ziyao233 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the typo, I think this PR is ready for merging. @mariospaok4 could you synchronize with master after Alpine workflow is fixed (#7289)? Then we can get this PR merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants